//
//  MainViewController.m
//  QQ-Zone
//
//  Created by 张洪毓 on 15/11/24.
//  Copyright © 2015年 张洪毓. All rights reserved.
//

#import "MainViewController.h"
#import "YUDockView.h"
@interface MainViewController ()
@property (nonatomic,strong) YUDockView *dock;
@property (nonatomic,strong) UIView *contentView;
@end

@implementation MainViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor yellowColor];
    
    YUDockView *dock = [[YUDockView alloc] init];
    dock.backgroundColor = [UIColor blueColor];
    dock.height = self.view.height;
    dock.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    [self.view addSubview:dock];
    self.dock = dock;
    
    UIView *contentView = [[UIView alloc] init];
    contentView.backgroundColor = [UIColor lightTextColor];
    self.contentView = contentView;
    contentView.width = kContentViewW;
    contentView.y = 0;
    contentView.height = self.view.height;
    contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
    [self.view addSubview:contentView];
    
    [self viewWillTransitionToSize:CGSizeMake(self.view.width, self.view.height) withTransitionCoordinator:NULL];
}

-(void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator{
    
    BOOL isLandscape = (size.width == 1024 ? YES : NO);
    self.dock.isLandscape = isLandscape;
    self.contentView.x = self.dock.width;
}





@end
